import upyun

class Myyun:
    def __init__(self):
        self.up = upyun.UpYun("image-ztl","zhangtinglei","jvJO2RLr7q5D8SceJcIDu6WKvhdAJtDN")
        self.upload_url = './static/upload/'
        # self.up = upyun.UpYun('lvhualongupyun','17631580697','DD5gRrk7IXBzHrmsLoy0sVGi9O8oM4eq')



    def putyun(self,upload_dir,file,userid):
        with open(upload_dir,'rb')as f:
            self.up.put('/'+str(userid)+'/'+file,f)

myyun = Myyun()
myyun.putyun('D:/p6/p6_cation/static/upload/1/a821cd5a3ebd43b6bde3cb7fba33354b.jpg','a821cd5a3ebd43b6bde3cb7fba33354b.jpg',1)


